package constant

import (
	"time"

	gocache "github.com/patrickmn/go-cache"
)

const (
	// jwt负载信息
	JwtKeyUserInfo     = "user"
	JwtKeyUserId       = "userId"
	JwtKeyUserName     = "username"
	JwtKeyUserRoleIds  = "roleIds"
	JwtKeyUserRoleName = "roleName"
	JwtKeyUserDeptIds  = "deptIds"
	JwtKeyUserDeptName = "deptName"
	JwtKeyAgencyId     = "agency"
	JwtKeyAppId        = "appId"
	// 默认分组id
	DefaultGroupId = "root"
	// 主题消息地址
	TopicPlaceholder = "$"
	// topic字段sn
	CacheLoginInfo = "cacheLoginInfo"
	CacheDevSn     = "devSn"
	CacheGateSn    = "gateSn"
	CacheDevType   = "devType"
	CacheFrom      = "from"
	CacheTo        = "to"
	// 历史数据缓存
	HistoryDataQueue = "HISDATA"
	// 设备分组缓存
	DeviceDeptCache = "DEVDEPT"
	// 设备简讯缓存
	DeviceEasyCache = "dev_cache"
	// 已处理消息主题
	HandledMsgTopic = "/ssdevice/handled/msg"
	// 设备操作消息主题
	DeviceDeleteMsgTopic = "/ssdevice/device/delete"
	DeviceAddMsgTopic    = "/ssdevice/device/add"
	// 设备登录顺序队列
	DeviceLoginCacheQueue = "login_data"
)

var (
	//配置文件
	ConfigFile = "config/ssdevice.yml"
	// 本地缓存
	LocalCache = gocache.New(10*time.Second, 3*time.Second)
)
